//
//  vdCheckbox.h
//  Void Dead
//
//  Created by Sidney Just on 19.12.09.
//
//  Copyright © 2009 by Sidney Just
//  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 
//  documentation files (the "Software"), to deal in the Software without restriction, including without limitation 
//  the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 
//  and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
//  INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
//  PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 
//  FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
//  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

#import <Foundation/Foundation.h>

#import "vdKernel.h"
#import "vdShape.h"
#import "vdLabel.h"
#import "vdNode.h"

/**
 * This class represents a checkbox with three states (normal, pressed and disabled)
 **/
@interface vdCheckbox : vdShape <vdGUIProtocol> {
	//\cond
	BOOL checked;
	BOOL enabled;
	
	id delegate;
	
	@private
	vdTexNode *stateNormal;
	vdTexNode *stateChecked;
	
	vdLabel *message;
	//\endcond
}

/**
 * If YES, the checkbox can change its state, otherwise NO.
 * <br>Default: YES
 **/
@property BOOL enabled;

/**
 * If YES, the checkbox is pressed, otherwise NO
 * <br>Default: NO
 **/
@property BOOL checked;


/**
 * Sets the texture for the normal state of the checkbox
 @param tex The new texture or NULL
 **/
- (void)setStateNormal:(vdTexNode *)tex;

/**
 * Sets the texture for the pressed state of the checkbox
 @param tex The new texture or NULL
 **/
- (void)setStateChecked:(vdTexNode *)tex;

/**
 * Sets a string that will be displayed on the right hand of the checkbox
 @param str The string that should be displayed or NULL
 **/
- (void)setString:(NSString *)str;

/**
 * Sets the delegate for the checkbox. The delegate will be notified about state changes of the checkbox
 @param del The delegate
 @remark The delegate must implement the vdInterfaceProtocol!
 **/
- (void)setDelegate:(id)del;

@end
